
let BMapGL = window.BMapGL
export let fillLayer = new BMapGL.FillLayer({
    crs: 'GCJ02', // 数据源坐标类型
    enablePicked: true,
    autoSelect: true,
    pickWidth: 30,
    pickHeight: 30,
    selectedColor: 'green', // 悬浮选中项颜色
    border: true,
    opacity: 1.0,
    style: { // 样式配置
        fillColor: ['case', ['boolean', ['feature-state', 'picked'], false], '#6704ff', ['match', ['get', 'name'], '海淀区', '#ce4848', '朝阳区', 'blue', '通州区', 'blue', '丰台区', 'red', '房山区', 'red', '#6704ff']],
        fillOpacity: .3,
        strokeWeight: 1,
        strokeColor: 'blue',
    }
});

fillLayer.addEventListener('click', function (e:any) {
    if (e.value.dataIndex !== -1 && e.value.dataItem) {
        console.log(e.value.dataItem);
        // this.updateState(e.value.dataIndex, { picked: true }, true)
    }
})
fillLayer.addEventListener('mousemove', function (e: any) {
    if (e.value.dataIndex !== -1 && e.value.dataItem) {
        console.log(e.value.dataItem);
    }
})
